package com.culturalCenter.dataCenter.enums;

import lombok.Getter;

/**
 * @author colors
 * @date 2021/5/27 15:17
 */
@Getter
public enum CrowdEnum {
    elder(1, "老年人"),
    disabler(2, "残疾人"),
    child(4, "儿童"),
    masses(8, "群众"),
    elder_disabler(3, "老年人,残疾人"),
    elder_child(5, "老年人,儿童"),
    elder_masses(9, "老年人,群众"),
    disabler_child(6, "残疾人,儿童"),
    disabler_masses(10, "残疾人,群众"),
    child_masses(12, "儿童,群众"),
    elder_disabler_child(7, "老年人,残疾人,儿童"),
    elder_disabler_masses(11, "老年人,残疾人,儿童"),
    elder_child_masses(13, "老年人,儿童,群众"),
    disabler_child_masses(14, "残疾人,儿童,群众"),
    elder_disabler_child_masses(15, "老年人,残疾人,儿童,群众"),
    other(0, "无限制");

    private int type;
    private String crowd;

    CrowdEnum(int type, String crowd) {
        this.type = type;
        this.crowd = crowd;
    }

    public static String getCrowd(Integer type) {
        CrowdEnum[] crowdEnums = CrowdEnum.values();
        for (CrowdEnum crowdEnum : crowdEnums) {
            if (type == crowdEnum.getType()) {
                return crowdEnum.getCrowd();
            }
        }
        return other.getCrowd();
    }
}
